<?php
/**
 * Created by PhpStorm.
 * User: jswei
 * Date: 2018/4/24
 * Time: 8:54
 */

namespace app\first\model;

use think\Model;

class UsedMoney extends Model{

    protected $autoWriteTimestamp = false;

    public function getMoneyAttr($value){
        if($value){
            $tmp = explode(';',$value);
            $arr = [];
            foreach ($tmp as $k => $v){
                $tmp1 = explode('|',$v);
                $data = [
                    'title'=>$tmp1[0],
                    'mian_fei'=>$tmp1[1],
                    'bu_xian_ci'=>$tmp1[2],
                    'price'=>$tmp1[3],
                ];
                array_push($arr,$data);
            }
            return $arr;
        }else{
            return [];
        }
    }
}